﻿@using CustomGrid
@using ForzaGT3.Data
@{
    ViewBag.Title = "Index";
}
<div class="well">
    @CustomGrid.DrawGrid("data", Model,
    CustomGrid.columns( 
                        CustomGrid.column("Series",
                                Series.GetAll().Select(v => new Conditions("SeriesId", "==", v.SeriesId.ToString(), v.Title)).ToArray(), new[] { "SeriesId" },
                                Series.GetAll().Select(v => new DropDownList { optionID = v.SeriesId.ToString(), optionValue = v.Title }).ToArray(), true),
                        CustomGrid.column("Time", "TimeElapsed", true, "left", "text"),
                        CustomGrid.column("Action",
                                    "<a href=\"/admin/result/edit/{0}\"><i class=\"icon-pencil\"></i></a>&nbsp;&nbsp;" +
                                    "<a href=\"/admin/result/delete/{0}\" onclick=\"javascript:return confirm('Are you sure you want to delete this?');\"><i class=\"icon-trash\"></i></a>", new[] { "ResultId" })),
    Request.QueryString)
</div>
@CustomGrid.PagingNumbers("data", Request.QueryString, ViewBag.totalRecords, "20")
<div class="pull-right">
    <a href="@Url.Action(MVC.Admin.Result.Add())" class="btn btn-large btn-inverse">Add</a>
</div>